﻿(function () {
  'use strict';

  var app = angular.module('ng4model');

  // Configure Toastr
  toastr.options.timeOut = 2000;
  toastr.options.positionClass = 'toast-bottom-right';

  // For use with the HotTowel-Angular-Breeze add-on that uses Breeze
  var remoteServiceName = 'api/Projects';

  var events = {
    controllerActivateSuccess: 'controller.activateSuccess',
    spinnerToggle: 'spinner.toggle'
  };

  var config = {
    appErrorPrefix: '[ng4model] ', //Configure the exceptionHandler decorator
    docTitle: 'ng4model app: ',
    events: events,
    remoteServiceName: remoteServiceName,
    version: '0.0.6'
  };

  app.value('config', config);

  app.config(['$logProvider', function ($logProvider) {
    // turn debugging off/on (no info or warn)
    if ($logProvider.debugEnabled) {
      $logProvider.debugEnabled(true);
    }
  }]);

  //#region Configure the common services via commonConfig
  app.config(['commonConfigProvider', function (cfg) {
    cfg.config.controllerActivateSuccessEvent = config.events.controllerActivateSuccess;
    cfg.config.spinnerToggleEvent = config.events.spinnerToggle;
  }]);
  //#endregion

  //#region Breeze Config
  //app.config(['zDirectivesConfigProvider', function (cfg) {
  //  cfg.zValidationTemplate = '<span class="invalid"><i class="icon-warning-sign icon-white"></i>%error%</span>';
  //}]);

  //#endregion

})();